n=123
def f(n):
    if n < 10:
        print(n,end=' ')
    else:
        f(n // 10)
        print(n % 10,end=' ')

f(n)